<template>
  <div class='app-container'>
    <div ref="graphContainer" class="parent-wrapper"></div>
  </div>
</template>

<script>
import mxgraph from '@utils/init.js';
const { mxGraph,mxClient,mxCodec,mxUtils,mxConstants,mxPerimeter } = mxgraph;

export default {
  name: 'ceshi',
  module_index: 100,
  module_name: '你好，世界',
  data() {
    return {};
  },
  created() { },
  mounted() {
    this.init();
  },
  methods: {
    init() {
      var graph = new mxGraph(this.$refs.graphContainer)

      // 创建全局父元素
      var parent = graph.getDefaultParent()

      // 在单个步骤中向模型添加单元
      const v1 = graph.insertVertex(parent,null,'Hello,',20,20,80,30)
      const v2 = graph.insertVertex(parent,null,'World!',200,150,80,30)

      // 连接组态单元
      graph.insertEdge(parent,null,'连接线文字',v1,v2)
    },
  }
};
</script>

<style scoped>
</style>